<?php

class HtmlOutput implements RegistryObject, ReportOutput {

	public function setup() {
	}

	public function getTitle() {
		return "html";
	}

	public function write($reportObj, $outputfile = null) {

		global $appRoot;

		$xslt_file = $appRoot."xsl/html.xsl";

		//Loading XML document
		$xml = $reportObj->getDOM();

		//Loading XSLT stylesheet
		$stylesheet = new DOMDocument;
		$stylesheet->substituteEntities = true;
		if ($stylesheet->load($xslt_file) == false)
			die('Failed to load XSLT file');


		//Performing XSLT transformation
		$xsl = new XSLTProcessor();
		$xsl->importStyleSheet($stylesheet);
		$output = $xsl->transformToXML($xml); // transforming

		echo $output;
	}

}

Registry::register("output", new HtmlOutput());

?>